﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using BusinessObject;

namespace GreenLife.Admin
{
    public partial class ThemDanhMuc : System.Web.UI.Page
    {
        CategoriesBO cBO = new CategoriesBO();
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btnAdd_Click(object sender, EventArgs e)
        {
                if (cBO.createCategory(txtName.Text, ddlType.SelectedValue.ToString(), txtDesc.Text))
                {
                    Response.Redirect("DanhSachDanhMuc.aspx");
                }
                else
                {
                    Response.Redirect("error.aspx?a=" + ddlType.SelectedValue.ToString());
                }
        }
    }
}